import {USER, USER_PAGE} from './api'
import {METHOD,req} from '@/utils/request'

export const page = async (params) => req(USER_PAGE, METHOD.GET, params);

export const getById = async (params) => req(USER, METHOD.GET, params);

export const save = async (params) => req(USER, METHOD.POST, params);

export const edit = async (params) => req(USER, METHOD.PUT, params);

export const remove = async (id) => req(`${USER}/${id}`, METHOD.DELETE, null);

export const list = async () => req(`${USER}/list`,METHOD.GET,null);

export const editPassword = async (params) => req(`${USER}/password`,METHOD.PUT,params);

export default {
    page,
    getById,
    save,
    edit ,
    remove,
    list,
    editPassword
}